package com.gold.service;


import java.util.List;

import com.gold.exception.ServiceException;

public abstract interface BaseService<T> {
	
	/**
	 * 按主键进行删除操作
	 * @param modelPK 主键
	 * @return
	 */
	boolean delete(Integer modelPK) throws ServiceException;

	/**
	 * 添加对象
	 * @param model
	 * @return
	 */
    boolean save(T model) throws ServiceException;

    /**
     * 根据主键获取数据对象
     * @param modelPK 主键
     * @return
     */
    T load(Integer modelPK) throws ServiceException;
    
    /**
     * 获取列表
     * @return
     */
    List<T> findAll() throws ServiceException;

    /**
     * 总记录数
     * @return
     * @throws ServiceException
    */
    int countAll() throws ServiceException;

    /**
     * 更新
     * @param model
     * @return
     */
    boolean update(T model) throws ServiceException;

}
